package com.idealighter.game.core.dao.generate.mapper;

import com.idealighter.game.core.dao.generate.domain.PlayerStatusRecordDomain;
import com.idealighter.game.core.dao.generate.domain.PlayerStatusRecordDomainExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface PlayerStatusRecordDomainMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_status_record
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @SelectProvider(type=PlayerStatusRecordDomainSqlProvider.class, method="countByExample")
    long countByExample(PlayerStatusRecordDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_status_record
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @DeleteProvider(type=PlayerStatusRecordDomainSqlProvider.class, method="deleteByExample")
    int deleteByExample(PlayerStatusRecordDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_status_record
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Delete({
        "delete from player_status_record",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_status_record
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Insert({
        "insert into player_status_record (player_id, register_ip, ",
        "register_time, login_ip, ",
        "login_time, login_count, ",
        "logout_time, gametime, ",
        "onlinetime, update_time)",
        "values (#{playerId,jdbcType=BIGINT}, #{registerIp,jdbcType=VARCHAR}, ",
        "#{registerTime,jdbcType=TIMESTAMP}, #{loginIp,jdbcType=VARCHAR}, ",
        "#{loginTime,jdbcType=TIMESTAMP}, #{loginCount,jdbcType=INTEGER}, ",
        "#{logoutTime,jdbcType=TIMESTAMP}, #{gametime,jdbcType=BIGINT}, ",
        "#{onlinetime,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(PlayerStatusRecordDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_status_record
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @InsertProvider(type=PlayerStatusRecordDomainSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insertSelective(PlayerStatusRecordDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_status_record
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @SelectProvider(type=PlayerStatusRecordDomainSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="player_id", property="playerId", jdbcType=JdbcType.BIGINT),
        @Result(column="register_ip", property="registerIp", jdbcType=JdbcType.VARCHAR),
        @Result(column="register_time", property="registerTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="login_ip", property="loginIp", jdbcType=JdbcType.VARCHAR),
        @Result(column="login_time", property="loginTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="login_count", property="loginCount", jdbcType=JdbcType.INTEGER),
        @Result(column="logout_time", property="logoutTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="gametime", property="gametime", jdbcType=JdbcType.BIGINT),
        @Result(column="onlinetime", property="onlinetime", jdbcType=JdbcType.BIGINT),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<PlayerStatusRecordDomain> selectByExample(PlayerStatusRecordDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_status_record
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Select({
        "select",
        "id, player_id, register_ip, register_time, login_ip, login_time, login_count, ",
        "logout_time, gametime, onlinetime, update_time",
        "from player_status_record",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="player_id", property="playerId", jdbcType=JdbcType.BIGINT),
        @Result(column="register_ip", property="registerIp", jdbcType=JdbcType.VARCHAR),
        @Result(column="register_time", property="registerTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="login_ip", property="loginIp", jdbcType=JdbcType.VARCHAR),
        @Result(column="login_time", property="loginTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="login_count", property="loginCount", jdbcType=JdbcType.INTEGER),
        @Result(column="logout_time", property="logoutTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="gametime", property="gametime", jdbcType=JdbcType.BIGINT),
        @Result(column="onlinetime", property="onlinetime", jdbcType=JdbcType.BIGINT),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    PlayerStatusRecordDomain selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_status_record
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @UpdateProvider(type=PlayerStatusRecordDomainSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") PlayerStatusRecordDomain record, @Param("example") PlayerStatusRecordDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_status_record
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @UpdateProvider(type=PlayerStatusRecordDomainSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") PlayerStatusRecordDomain record, @Param("example") PlayerStatusRecordDomainExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_status_record
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @UpdateProvider(type=PlayerStatusRecordDomainSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(PlayerStatusRecordDomain record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table player_status_record
     *
     * @mbg.generated Tue Aug 14 14:13:21 CST 2018
     */
    @Update({
        "update player_status_record",
        "set player_id = #{playerId,jdbcType=BIGINT},",
          "register_ip = #{registerIp,jdbcType=VARCHAR},",
          "register_time = #{registerTime,jdbcType=TIMESTAMP},",
          "login_ip = #{loginIp,jdbcType=VARCHAR},",
          "login_time = #{loginTime,jdbcType=TIMESTAMP},",
          "login_count = #{loginCount,jdbcType=INTEGER},",
          "logout_time = #{logoutTime,jdbcType=TIMESTAMP},",
          "gametime = #{gametime,jdbcType=BIGINT},",
          "onlinetime = #{onlinetime,jdbcType=BIGINT},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(PlayerStatusRecordDomain record);
}